import {
  SET_WAREHOUSE_QUERY_ITEM_DETAILS,
  SET_WAREHOUSE_QUERY_LOC_DETAILS
} from "./action-types";

const initialState = {
  itemDetails: null,
  locDetailList: []
};

const data = (state = initialState, action) => {
  switch (action.type) {
    case SET_WAREHOUSE_QUERY_ITEM_DETAILS:
      return { ...state, itemDetails: action.payload };
    case SET_WAREHOUSE_QUERY_LOC_DETAILS:
      return { ...state, locDetailList: action.payload.items };
    default:
      return state;
  }
};

export default data;
